<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Progress Indicator on Heading</title>

	<script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
	<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script>

	<script type="text/javascript">
		require([
			"dojo/dom-class",
			"dojo/ready",
			"dijit/registry",
			"dojox/mobile/ProgressIndicator",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/compat"
		], function(domClass, ready, registry, ProgressIndicator){
			ready(function(){
				var prog1 = new ProgressIndicator({size:30, center:false});
				prog1.domNode.style.position = "absolute";
				prog1.domNode.style.margin = "5px";
				domClass.add(prog1.domNode, "mblProgWhite");
				var head1 = registry.byId("head1");
				prog1.placeAt(head1.domNode);
				prog1.start();
				setTimeout(function(){ // network latency simulation
					prog1.stop();
					head1.set("label", "Done");
				}, 5000);

				var prog2 = new ProgressIndicator({size:30, center:false});
				prog2.domNode.style.position = "absolute";
				prog2.domNode.style.margin = "5px";
				prog2.domNode.style.right = "0px";
				domClass.add(prog2.domNode, "mblProgWhite");
				var head2 = registry.byId("head2");
				prog2.placeAt(head2.domNode);
				prog2.start();
				setTimeout(function(){ // network latency simulation
					prog2.stop();
					head2.set("label", "Done");
				}, 5000);
			});
		});
	</script>
</head>
<body style="visibility:hidden;">
	<div id="foo" data-dojo-type="dojox.mobile.View">
		<h1 id="head1" data-dojo-type="dojox.mobile.Heading">Loading...</h1>
	 	<br><br>
		<h1 id="head2" data-dojo-type="dojox.mobile.Heading">Loading...</h1>
	</div>
</body>
</html>
